package com.etc.test;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.etc.entity.Blog;
import com.etc.service.BlogService;

/**
*	@author: zmf  
*	@date: 2018年11月12日 上午10:40:09 
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations= {"classpath:applicationContext.xml","classpath:mybatis-config.xml"})
public class SpringjunitBlog {
	@Autowired
	private BlogService blogService;
	
	@Test
	public void select() {
		Blog blog=blogService.getBlogById(7);
		System.out.println(blog);
	}
	
	@Test
	public void insert() {
		Blog blog=new Blog();
		blog.setBlogtitle("测试19");
		blog.setBlogcontent("ceshih");
		blog.setAuthorid(5);
		boolean flag=blogService.insert(blog);
		System.out.println(flag);
	}
	

}

